<?php
namespace app\platform\controller;
use app\core\controller\core;
use app\core\controller\Error;

/**
 * @title 总平台接口
 * @description 总平台接口
 */
class Index
{

    private $core,$err;

    function __construct()
    {
        //加载core类
        $this->core = new core();
        //加载Error类
        $this->re = new Error();
    }

    /**
     * @title 登录
     * @description 总平台登录
     * @author roy
     * @url /platform/index/index
     * @method POST
     * @param name:id type:int require:1 default:1 other: desc:唯一ID
     *
     */
    public function index()
    {
        //输入
        $this->re->auto('post');
        //入口数据
        $in = $this->re->in;
        //定义必传值,isZero为1时表示不能传空或零，为0时表示不能传空。
        $key=[
            'mobile'=>['isZero'=>1],
            'type'=>['isZero'=>0],
        ];
        $em = $this->re->will($key,$in);
        if($em['code']!='000000'){
            return  $this->re->out($em['code'],$em['msg'],1);
        }
        //-----------------------------------------------------------------------------------



        //-----------------------------------------------------------------------------------
        //输出:
        $this->re->data = $in;
        return  $this->re->out();
    }
}
